package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.config.FeignConfig;
import com.ruoyi.system.api.factory.RemoteUserFallbackFactory;
import com.ruoyi.system.api.model.Project;
import com.ruoyi.system.api.model.Scene;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 流程管理系统服务
 *
 * @author ruoyi
 */
@FeignClient(contextId = "remotePmsService", value = ServiceNameConstants.PMS_SERVICE, configuration = FeignConfig.class, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemotePmsService {
    /**
     * 通过项目id查询项目信息
     *
     * @param id     项目id
     * @param source 请求来源
     * @return
     */
    @GetMapping("/project/{id}")
    public R<Project> getProject(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);



    /**
     * 通过项目id查询项目信息
     *
     * @param id     项目id
     * @param source 请求来源
     * @return
     */
    @GetMapping("/scene/{id}")
    public R<Scene> getScene(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
